package com.itboye.textileexpres.order;

import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;

import android.R.integer;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;

import com.itboye.textileexpes.presenter.ShopCartPresenter;
import com.itboye.textileexpres.R;
import com.itboye.textileexpres.base.BaseFragment;
import com.itboye.textileexpres.base.ResultEntity;
import com.itboye.textileexpres.widget.MyListView;
import com.itboye.textileexpres.widget.XListView;

public class FragmentMyOrder extends BaseFragment {
	int i;
	// TextView tv;
	ListView mylist;
	FragmentMyOrderAdapter adapter;

	public FragmentMyOrder(int i) {
		// TODO Auto-generated constructor stub
		this.i = i;
	}

	@Override
	public int initView() {
		// TODO Auto-generated method stub
		return R.layout.fragment_myorder;
	}

	@Override
	public void onMyActivityCreated() {
		// TODO Auto-generated method stub
		// tv.setText("" + i);

		adapter = new FragmentMyOrderAdapter(getActivity());
		mylist.setAdapter(adapter);
		mylist.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(getActivity(),
						ActvityOrderDetail.class);
				intent.putExtra("type", i + "");
				startActivity(intent);

			}
		});
	}

}
